Stream priority

ABSTRACT

A system, method and apparatus for prioritizing transactions is disclosed. I/O devices may generate transactions with a stream identifier. A transaction classifier may assign a priority to a transaction based upon a stream identifier of the transaction. An arbiter may select a transaction for processing based upon priorities assigned to the transaction.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a Continuation of U.S. patent application Ser. No.11/020,500, Filed on Dec. 21, 2004, and entitled “STREAM PRIORITY”,which was granted as a Patent on Aug. 23, 2011 with U.S. Pat. No.8,006,017, which is a continuation of U.S. patent application Ser. No.13/216,230, Filed on Aug. 23, 2011, and entitled “STREAM PRIORITY”.These applications are incorporated herein by reference in theirentirety.

BACKGROUND

Input-output (I/O) devices connected to a data bus follow specifictransaction ordering rules. For example, a computer I/O hub connected toa peripheral component interface (PCI) bus preserves an order of thetransactions received from an I/O controller through the PCI bus. TheI/O hub implements an I/O interface using modified first-in-first-out(FIFO) queues to store the transactions received from the I/O devices inan order that obey PCI ordering rules.

When an I/O controller initiates an ordered sequence of transactions,the I/O hub stores the transactions in the modified FIFO queues andexecutes the transactions in the order received. A transaction, whichcomes after earlier transactions, can not be executed until the earliertransactions are executed. Thus, if one transaction is stalled all theremaining transactions will be stalled.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention described herein is illustrated by way of example and notby way of limitation in the accompanying figures. For simplicity andclarity of illustration, elements illustrated in the figures are notnecessarily drawn to scale. For example, the dimensions of some elementsmay be exaggerated relative to other elements for clarity. Further,where considered appropriate, reference labels have been repeated amongthe figures to indicate corresponding or analogous elements.

FIG. 1 illustrates an embodiment of a computer system.

FIG. 2 illustrates an embodiment of a transaction descriptor whereinbits of a tag field are repurposed for a stream identifier (ID) field.

FIG. 3 illustrates an embodiment of a transaction descriptor whereinbits of a function number field are repurposed for a stream ID field.

FIG. 4 illustrates another embodiment of a transaction descriptorwherein bits of a tag field and a function number field are repurposedfor a stream ID field.

FIG. 5 illustrates a flow for handling a high priority memorytransaction.

DETAILED DESCRIPTION

In the following detailed description, numerous specific details aredescribed in order to provide a thorough understanding of the invention.However the present invention may be practiced without these specificdetails. In other stances, well known methods, procedures, componentsand circuits have not been described in detail so as not to obscure thepresent invention. Further, example sizes/models/values/ranges may begiven, although the present invention is not limited to these specificexamples.

References in the specification to “one embodiment”, “an embodiment”,“an example embodiment”, etc., indicate that the embodiment describedmay include a particular feature, structure, or characteristic, butevery embodiment may not necessarily include the particular feature,structure, or characteristic. Moreover, such phrases are not necessarilyreferring to the same embodiment. Further, when a particular feature,structure, or characteristic is described in connection with anembodiment, it is submitted that it is within the knowledge of oneskilled in the art to affect such feature, structure, or characteristicin connection with other embodiments whether or not explicitlydescribed.

Referring to FIG. 1, an embodiment of a computer system is shown. Thecomputer system may include one or more processors 100, a chipset 105, amemory 110, and one or more I/O devices 115. As shown, a processor bus120 may couple the processors 100 with the chipset 105. Similarly, amemory bus 125 may couple the memory 110 with the chipset 105 and one ormore I/O buses 130 may couple the I/O devices 115 with the chipset 105.

The processors 100 may execute software routines stored in the memory110. In particular, the processor 100 in one embodiment may configurethe transfer of data between the I/O devices 115 and the memory 110.Further, the processor 100 may define a traffic class (TC) to virtualchannel (VC) map and a stream identifier (ID) to priority map thatdefine how the chipset 105 processes transactions of the I/O device 115.

The chipset 105 may comprise one or more integrated circuits or chips tocouple the processors 100 with other components of the computer system.The chipset 104 may comprise a memory controller 135 to read from and/orwrite data to the memory 110 in response to read and write transactionsof the processor 102 and/or the I/O devices 115. As will be explained indetail below, the chipset 105 may prioritize transactions of the devices115 and may process transactions in an order other than the order inwhich the transactions were received.

The memory 110 may comprise one or more memory devices that provideaddressable storage locations from which data may be read and/or towhich data may be written. The memory 110 may also comprise one or moredifferent types of memory devices such as, for example, DRAM (DynamicRandom Access Memory) devices, SDRAM (Synchronous DRAM) devices, DDR(Double Data Rate) SDRAM devices, or other volatile and/or non-volatilememory devices.

The I/O devices 115 may provide various input/output functions for thecomputer system. For example, the I/O devices 115 may comprise networkadaptors, hard disk drives, keyboards, mice, CD (compact disc) drives,DVD (digital video disc) drives, printers, scanners, etc. Further, theI/O devices 115 may be coupled to the chipset 105 via one or more I/Obuses 130. In one embodiment, the I/O devices 115 may comprise PCI(Peripheral Component Interconnect) Express components and the buses 130may comprise PCI Express point-to-point serial links that operate in amanner based upon the PCI Express Base Specification Revision 1.0 ofJul. 22, 2002 (hereinafter “PCI Express Spec”). However, the I/O devices115 and the I/O buses 130 in other embodiments may operate in accordancewith other interconnect technologies such as PCI, USB (Universal SerialBus), SATA (Serial Advanced Technology Attachment), etc.

In one embodiment, the I/O devices 130 may generate PCI transactionlayer packets that comprise a transaction layer packet (TLP) header, adata payload, and a transaction layer packet (TLP) digest as depicted inFIGS. 2-4. The header may provide various information about the natureof the packet. For example, the header may indicate a packet format, apacket type, a data length, a transaction descriptor, address/routinginformation, byte enables, a message encoding, and a completion status.In particular, the transaction descriptor may comprise a transactionidentified (ID) field, an attributes field and a traffic class field.

The transaction ID field may uniquely identify outstanding transactions.To this end, the transaction ID field in one embodiment may comprise arequester identifier (ID) field and a tag field. The requester ID fieldmay uniquely identify a requester or originator of a transaction, andthe tag field may uniquely identify outstanding transactions of arequester that require a completion transaction. In a PCI Expressembodiment, the requester ID field comprises a 16-bit value that isunique for each PCI Express function within a PCI Express hierarchy. Asdepicted, the requester ID field in one embodiment may comprise a busnumber field, a device number field, and a function number field.

In a PCI Express embodiment, transactions may originate from a hierarchyof PCI Express functions. In particular, the hierarchy may comprise oneor more buses. One or more devices may be coupled to each bus, and eachdevice may comprise one or more functions or requestors. Accordingly,the requestor ID field may comprise a bus number field to uniquelyidentify to which bus a requestor is coupled, a device number field touniquely identify on which device of the identified bus the requesterresides, and a function number field to uniquely identify which functionof the identified device is the requestor. In particular, the PCIExpress Spec defines a 16-bit requester ID field comprising an 8-bit busnumber field, a 5-bit device number field, and a 3-bit function numberfield.

As indicated above, the tag field may uniquely identify outstandingtransactions of a requester that require a completion transaction. Inone embodiment, a requester generates a tag for each transaction suchthat the tag is unique for all outstanding transactions that require acompletion transaction. In one embodiment, the requester may reuse a tagvalue for transactions that don't require a completion transaction suchas, for example, a posted memory write. The requester may also reuse atag value after a corresponding transaction completes and is no longeroutstanding.

The PCI Express Spec defines an 8-bit tag field. However, the PCIExpress Spec indicates that by default that a requestor is limited to 32outstanding transactions thus using only the lower 5 bits of the tagfield to uniquely tag outstanding transaction. The PCI Express Specfurther indicates that an extended tag field bit may be enabled to allowthe requester to use the full 8 bits of the tag field and thereforeenable tagging of up to 256 outstanding transactions. Furthermore, thePCI Express Spec indicates that phantom function numbers may be used tofurther extend the number of outstanding requests. Basically, an I/Odevice 115 may assign more than one function number to a singlefunction, thereby allowing the function to have more than 256outstanding transaction. However, in such a case, the combination of thephantom function number and the tag must be unique for all outstandingtransaction that require a completion.

The attributes field may provide additional information about atransaction. In one embodiment, the attributes field may indicatewhether the transaction may be handled with relaxed ordering rules.Further, the attributes field in one embodiment may indicate whether thetransaction requires hardware enforced cache coherency mechanisms suchas snoop transactions.

The traffic class field may enable a requester to place transactionsinto different traffic classes to differentiate handling of certaintransactions. In one embodiment, the transaction descriptor comprises a3-bit traffic class field that enables a requester to place transactionsinto 1 of 8 different traffic classes.

Referring back to FIG. 1, the chipset 105 may comprise one or more ports140 and a transaction classifier 145. The ports 140 may provide aphysical interface for sending and receiving transactions to and fromthe I/O devices 115. The transaction classifier 145 may classifytransactions based upon a traffic class and a stream identifier (ID) ofa transaction. In particular, the transaction classifier 145 may maptransactions to virtual channels 150 and priority queues 155 based upona traffic class to virtual channel (TC-to-VC) map 160 and a streamID-to-priority map 170.

The TC-to-VC map 160 may map traffic classes to virtual channels 150. Inone embodiment, the chipset 105 may support 8 different virtual channels150 thus allowing each of the 8 different traffic classes TC0-TC7 to bemapped to a unique virtual channel 150. However, the TC-to-VC map 160may map more than one traffic class TC to a virtual channel 150 whichallows requesters to label their transactions with any of the 8 trafficclasses TC0-TC7 even if the chipset 105 supports fewer than 8 virtualchannels 150. For example, the PCI Express Spec requires the chipset105, in a PCI Express embodiment, provide support for at least onevirtual channel VC0 and to hardwire the mapping of traffic class TC0 tovirtual channel VC0. Thus, in an embodiment having a single virtualchannel VC0, the TC-to-VC map 160 may map the other traffic classesTC1-TC7 to the sole virtual channel VC0.

In general, the virtual channels 150 may enable a single communicationlink or I/O bus 130 to appear as having multiple independentcommunication channels. In particular, the chipset 105 may compriseseparate buffers and flow control mechanisms for each virtual channel150 thus allowing transactions to continue on one virtual channel 150 ofa link even though transactions of other virtual channels 150 arestalled or waiting for completion of other transactions. Furthermore,the virtual channels 150 provide a mechanism to differentiate betweentransactions. In particular, the chipset 105 may give transactions ofone virtual channel 150 higher priority than transactions of anotherchannel 150. To this end, the chipset 105 may further comprise a virtualchannel arbiter 180 to arbitrate between the virtual channels 150. Thevirtual channel arbiter 180 may use various arbitration policies such asa strict priority policy, a round robin policy, a weighted round robinpolicy, etc. to select a transaction from the virtual channels 150 forprocessing.

One issue in regard to virtual channels 150 is that virtual channels 150are costly to implement due to each virtual channel 150 needing its ownbuffers and flow control resources so that the virtual channels 150 mayproceed independently of one another. Accordingly, the chipset 105 mayfurther support differentiating between transactions based upon a streamID. Basically, an I/O device 115 may label or tag transactions withdifferent stream IDs in order to give different priorities to differenttypes of transactions. The transaction classifier 145 may then assignpriorities to the transactions based upon the stream ID-to-priority map170 and the stream ID of the transaction.

In one embodiment, the chipset 105 may comprise one or more registersthat identify where in the memory 110 the stream ID-to-priority map 170is stored. In another embodiment, the chipset 105 may internally storethe stream ID-to-priority map 170 in one or more registers of thechipset. The stream ID-to-priority map 170 in one embodiment maycorrelate a stream ID with a priority level. In another embodiment, thestream ID-to-priority map 170 may further enable separate stream ID topriority level mappings for each requester ID.

In one embodiment, the transaction classifier 145 may store transactionsin separate priority queues 155 of a virtual channel 150 based upon theidentified priority for the stream ID of the transaction. For example,in one embodiment, the chipset 105 may support eight stream IDs andeight separate priority queues 155-0, 155-1 . . . 150-7 that run fromlow priority to high priority respectively. Furthermore, the streamID-to-priority map 170 may directly map stream IDs to queues such that astream ID of 0 maps to queue 155-0, a stream ID of 1 maps to queue155-1, and so on. In such and embodiment, an I/O device 115 may give atransaction a stream ID of 0 in order to assign the transaction thelowest priority and may give another transaction a stream ID of 7 inorder to assign the transactions the highest priority.

The chipset 105 may support one or more predefined stream ID-to-prioritymappings such as the above direct mapping. One of the predefinedmappings may be enabled by default. Furthermore, one of the predefinedmappings may be selected by updating one or more bits of a register.Such predefined mappings may greatly reduce the storage requirements fora particular implementation of the stream ID-to-priority map 170.

In one embodiment, each virtual channel 150 may comprise a separatephysical queue for each priority level supported by the chipset 105 andthe stream ID-to-priority map 170. In another embodiment, each virtualchannel 150 may logically comprise a separate logical queue for eachpriority level supported by the chipset 105 and the streamID-to-priority map 170. In particular, each virtual channel 150 maycomprise a single buffer in which all transactions of the virtualchannel 150 are stored. The stream ID-to-priority map 170 may then tageach transaction with its priority level when storing the transaction inthe virtual channel buffer. The virtual channel arbiter 180 may thenselect transactions from the virtual channels 150-0, 150-1 based uponthe priorities of the stored transactions as well as the priorities ofthe virtual channels 150-0, 150-1.

At any rate, prioritizing transactions of a virtual channel 150 mayenable higher priority transactions of a virtual channel 150 toessentially pass earlier lower priority transactions. It should beappreciated that tagging transactions with stream IDs may achieve someof the benefits associated with virtual channels 150. In particular,tagging transactions with stream IDs may enable higher prioritytransactions to complete before earlier lower priority transactions andmay prevent lower priority transactions from stalling higher prioritytransactions. However, in general the stream IDs may be implemented in aless costly manner than traffic classes since stream IDs do not requiremultiple virtual channels 150 in order to distinguish betweentransactions of different priorities.

Referring now to FIGS. 2-4, transaction ID field embodiments forimplemented stream IDs within a PCI Express transaction descriptor areshown. For example, FIG. 2 illustrates that one or more bits of the tagfield may be repurposed as a stream ID field. As indicated above, onlythe lower 5 bits of the 8-bit tag field in a PCI Express requester IDfield are used for uniquely tagging outstanding transactions of therequester. As a result, in one embodiment, the chipset 105 and the I/Odevices 115 utilize the unused upper 3 bits of the tag field for a 3-bitstream ID. Accordingly, in such an embodiment, an I/O device 115 mayassign its outstanding transactions to 1 of 8 different streams orpriorities by placing an appropriate stream ID in the upper 3 bits ofthe tag field.

Another transaction descriptor embodiment is illustrated in FIG. 3wherein one or more bits of the function number field are repurposed fora stream ID field. Some PCI devices are single function devices. Forsuch devices, the bits of the function number field essentially gounused since the function number does not change for these singlefunction devices. As a result, in one embodiment, the chipset 105 andthe I/O devices 115 may utilize the unused function number field for astream ID field.

Yet another transaction descriptor embodiment is illustrated in FIG. 4wherein one or more bits of the function number field and the tag fieldare repurposed for a stream ID field. Some PCI devices have less thanfive functions. As a result, the highest order bit of the 3-bit functionnumber field essentially goes unused for these I/O devices 115 withfewer than 5 functions. Therefore, in one embodiment, the chipset 105and the I/O devices 115 may utilize the unused upper three bits of thetag field and the upper bit of the function number field for a stream IDfield. In such an embodiment, an I/O device 115 may assign itsoutstanding transactions to one of 16 different streams or priorities byplacing an appropriate stream ID in a 4-bit stream ID field thatcomprises the upper bit of the function number field and the upper 3bits of the tag field.

In one embodiment, the chipset 105 and I/O devices 115 are hardwired touse one of the above transaction descriptors depicted in FIGS. 2-4 orsome other stream ID transaction header. In another embodiment, thechipset 105 and the I/O devices 115 may be programmed to use on of theabove transaction descriptors depicted in FIGS. 2-4 or some other streamID transaction header. In yet another embodiment, the transaction layerpacket header may include one or more bits that identify the format ofthe transaction descriptor thus enabling the chipset 105 and I/O devices115 to dynamically select a suitable transaction descriptor format.

Reference is now made to FIG. 5 which depicts the flow of a highpriority transaction to illustrate the process for handling prioritizedstreams. In block 500, an I/O device 115 may generate a memory readtransaction with a high priority stream ID in the stream ID field and ageneral purpose traffic class. The I/O device 115 may elect to generatethe memory read transaction with a high priority stream ID due to theI/O device 115 determining that the memory read transaction should beprocessed quickly in order to achieve desired performance levels. Forexample, the I/O device 115 may assign isochronous transactions such asmemory read transactions associated with audio and/or video streams ahigh priority in order to reduce the odds of encountering a playbackglitch. In another example, the I/O device 115 may assign a memory readtransaction of a TCP/IP offload engine that is crucial to networkperformance a high priority in order to improve the latency of thememory read transaction and the performance of the network.

In response to receiving the memory read transaction, the transactionclassifier 145 in block 510 may classify the memory read transactionbased upon its stream ID field and its traffic class field. Inparticular, the transaction classifier 145 may determine to place thememory read transaction in the general purpose virtual channel 150-0based upon the traffic class of the memory read transaction and theTC-to-VC map 160. Furthermore, the transaction classifier 145 maydetermine to place the memory read transaction in the highest priorityqueue 155-8 of the chosen virtual channel 150-0 based upon the stream IDof the transaction and the stream ID-to-priority map 170.

In block 530, the arbiter 180 may select the memory read transactionfrom the virtual channels 150-0, 150-1 based upon priorities of thevirtual channels and their respective queues 155. In particular, thearbiter 180 may select the memory read transaction ahead of earlierreceived lower priority transactions of the virtual channel 150-0.Finally, the memory controller 135 in block 540 may process the memoryread transaction and cause a completion transaction with the requesteddata to be returned to the I/O device 115.

Certain features of the invention have been described with reference toexample embodiments. However, the description is not intended to beconstrued in a limiting sense. Various modifications of the exampleembodiments, as well as other embodiments of the invention, which areapparent to persons skilled in the art to which the invention pertainsare deemed to lie within the spirit and scope of the invention.

What is claimed is:
 1. A non-transitory computer-readable storage mediumhaving one or more instructions stored thereon, that when executed on aprocessor cause the processor to: receive a first amount of informationassociated with a first I/O request, the first amount of informationallowing a determination of a first priority level being associated withthe first I/O request; store at least a portion of the first amount ofinformation in a first queue, the first queue configured to storeinformation at least related to one or more I/O requests associated withthe first priority level; receive a second amount of information afterthe receiving of the first amount of information, the second amount ofinformation associated with a second I/O request, the second amount ofinformation allowing a determination of a second priority level beingassociated with the second I/O request, wherein the second prioritylevel is higher than the first priority level; store at least a portionof the second amount of information in a second queue, the second queueconfigured to store information at least related to one or more I/Orequests associated with the second priority level; and process thesecond I/O request prior to the first I/O request due to the secondpriority level being higher than the first priority level.
 2. Thenon-transitory computer-readable storage medium of claim 1 to furthercause the processor to: initiate a memory transaction utilized to sendthe first amount of information to the I/O controller.
 3. Thenon-transitory computer-readable storage medium of claim 2, wherein thememory transaction comprises a request to read an amount of data fromthe at least one storage device and then write the amount of data to amemory.
 4. The non-transitory computer-readable storage medium of claim2, wherein the memory transaction comprises a request to read an amountof data from a memory and then write the amount of data to the at leastone storage device.
 5. The non-transitory computer-readable storagemedium of claim 1, wherein the I/O controller is integrated into atleast an I/O hardware complex, the I/O hardware complex additionallycomprising hardware storage logic, the hardware storage logic comprisingat least the first queue and the second queue.
 6. The non-transitorycomputer-readable storage medium of claim 1, wherein the first queuebeing configured to store information exclusively associated with thefirst priority level and the second queue being configured to storeinformation exclusively associated with the second priority level. 7.The non-transitory computer-readable storage medium of claim 1, whereinthe second I/O request comprises one of a plurality of I/O requests thatare all associated with a stream of information, the stream ofinformation being associated with the second priority level, wherein theplurality of I/O requests requiring processing by the I/O control logicin a certain order.
 8. The non-transitory computer-readable storagemedium of claim 2, wherein the I/O controller comprises a PeripheralComponent Interconnect Express controller, wherein the I/O control logicis further configured to transfer I/O requests to and from the at leastone storage device within Peripheral Component Interconnect Expresspackets, and wherein at least a portion of the first amount ofinformation is included into a header of a first Peripheral ComponentInterconnect packet associated with the first I/O request.
 9. A method,comprising: input/output (I/O) hardware control logic receiving a firstamount of information associated with a first I/O request, the firstamount of information allowing a determination of a first priority levelbeing associated with the first I/O request; input/output (I/O) hardwarecontrol logic storing at least a portion of the first amount ofinformation in a first queue, the first queue configured to storeinformation at least related to one or more I/O requests associated withthe first priority level; input/output (I/O) hardware control logicreceiving a second amount of information after the receiving of thefirst amount of information, the second amount of information associatedwith a second I/O request, the second amount of information allowing adetermination of a second priority level being associated with thesecond I/O request, wherein the second priority level is higher than thefirst priority level; input/output (I/O) hardware control logic storingat least a portion of the second amount of information in a secondqueue, the second queue configured to store information at least relatedto one or more I/O requests associated with the second priority level;and input/output (I/O) hardware control logic processing the second I/Orequest prior to the first I/O request due to the second priority levelbeing higher than the first priority level.
 10. The method of claim 9,further comprising: a processor initiating a memory transaction utilizedto send the first amount of information to an I/O controller, the I/Ocontroller being coupled to a storage device.
 11. The method of claim10, wherein the memory transaction comprises a request to read an amountof data from the at least one storage device and then write the amountof data to a memory.
 12. The method of claim 10, wherein the memorytransaction comprises a request to read an amount of data from a memoryand then write the amount of data to the at least one storage device.13. The method of claim 9, wherein the first queue being configured tostore information exclusively associated with the first priority leveland the second queue being configured to store information exclusivelyassociated with the second priority level.
 14. The method of claim 9,wherein the second I/O request comprises one of a plurality of I/Orequests that are all associated with a stream of information, thestream of information being associated with the second priority level,wherein the plurality of I/O requests requiring processing by the I/Ocontrol logic in a certain order.
 15. The method of claim 10, whereinthe I/O controller comprises a Peripheral Component Interconnect Expresscontroller, wherein the I/O control logic is further configured totransfer I/O requests to and from the at least one storage device withinPeripheral Component Interconnect Express packets, and wherein at leasta portion of the first amount of information is included into a headerof a first Peripheral Component Interconnect packet associated with thefirst I/O request.